<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li{
      width: 500px;
      height: 50px;
      background-color: rgb(180, 42, 42);
    }
    li:nth-child(2n){
      background-color: rgb(120, 194, 24);
    }
  </style>
</head>
<body>
  <div id="app">
    <input type="text" v-model="msg">
    <button @click="arr.push(111)">按钮</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        msg: '你好vue',
        arr: [1,2,3,4]
      },
      watch: {
        msg(newVal, oldVal){
          console.log(newVal);
        },
        arr(newVal){
          console.log(newVal);
        }
      }
    })
  </script>
</body>
</html>